-
Notifications
You must be signed in to change notification settings - Fork 61
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Compatibility changes to support mongodb_ecto adapter #227
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…e same name The application env variable called `log` is meant to be either a boolean or atom log level, whereas the function option called `log` is potentially a function or MFA tuple that is passed down to DBConnection.
This function is copied from the older `mongodb` driver for compatibility with the ecto adapter
Thanks for the PR. I will take a look at it as soon as possible. Maybe at the weekend. |
Thank you. I need to draft a new release, but this will break the API a bit because the |
LKlemens
pushed a commit
to LKlemens/elixir-mongodb-driver
that referenced
this pull request
Feb 2, 2024
* Add BSON encoders for Elixir Date/NaiveDateTime * Return FindAndModifyResult struct from appropriate operations * Fix conflation of application `log` env var and function option of the same name The application env variable called `log` is meant to be either a boolean or atom log level, whereas the function option called `log` is potentially a function or MFA tuple that is passed down to DBConnection. * Add generic Mongo.update/4 function This function is copied from the older `mongodb` driver for compatibility with the ecto adapter * Update tests for functions returning FindAndModifyResult * Mix format * Update array_filters test for FindAndModifyResult structs
I released a new version 1.4.0 (https://hex.pm/packages/mongodb_driver)! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The mongodb_ecto package wishes to switch its underlying driver to this one, since it has better support for current MongoDB versions. However, a series of changes are required to support the adapter.
Some BSON encoders and a missing generic update function were added for the adapter. Plus, a small option fix for the
do_log
function inmongo.ex
.Most notably, the find-then-modify command functions
find_one_and_update
andfind_one_and_replace
now return appropriateFindAndModifyResult
structs that contain additional write information otherwise neglected, which the adapter requires. This is also consistent with the other existing mutative command functions that already return respective result structs.